﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Framework;
using DotNetNuke.Services.FileSystem;
using DotNetNuke.Services.Localization;
using FortyFingers.Windows8Pin.Components;

namespace FortyFingers.Windows8Pin
{
    public partial class View : PortalModuleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // meta tags to create:
            //<meta name="application-name" content="TITLE"/> 
            //<meta name="msapplication-TileColor" content="COLOR"/> 
            //<meta name="msapplication-TileImage" content="IMAGEURL"/> 

            var _config = new Config(Settings, ModuleId, TabModuleId);

            Page.Header.Controls.Add(new HtmlMeta()
                                         {
                                             Name = "application-name",
                                             Content = _config.TileTitle
                                         });

            Page.Header.Controls.Add(new HtmlMeta()
                                         {
                                             Name = "msapplication-TileColor",
                                             Content = _config.TileBackground
                                         });

            if(!String.IsNullOrEmpty(_config.TileImageUrl))
            Page.Header.Controls.Add(new HtmlMeta()
                                         {
                                             Name = "msapplication-TileImage",
                                             Content = PortalSettings.HomeDirectory + _config.TileImageUrl
                                         });

        }

    }
}